<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{{siteName}}-修改基本信息</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="{{ADMIN_DOMAIN}}static/layui/css/layui.css?version={{version}}" media="all">
  <link rel="stylesheet" href="{{ADMIN_DOMAIN}}static/style/admin.css?version={{version}}" media="all">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">修改基本信息</div>
          <div class="layui-card-body" pad15>
            
            <div class="layui-form" lay-filter="">
            <form id="myform" onsubmit="return false">
              <div class="layui-form-item">
                <label class="layui-form-label">客户名称</label>
                <div class="layui-input-inline">
                  <input type="text" name="cname" autocomplete="off"  value="{{info.cname}}" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">appid</label>
                <div class="layui-input-inline">
                  <input type="text" name="appid"  disabled value="{{info.appid}}" autocomplete="off" id="LAY_password" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">16个英文字符，一般不建议修改</div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">秘钥</label>
                <div class="layui-input-block">
                  <input type="text" name="appsecret"  autocomplete="off" class="layui-input" placeholder="如果填写了那么代表修改系统会进行修改">
                </div>
                <div class="layui-form-mid layui-word-aux">100个英文字符 ，<a  style="color:red;" href="{{getu('user/makeSecret')}}" target="_blank">点击我在线生成</a></div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">回调地址</label>
                <div class="layui-input-block">
                  <input type="text" name="notice_url"  value="{{info.notice_url}}" autocomplete="off" class="layui-input ">
                </div>
                <div class="layui-form-mid layui-word-aux">请确保URL地址能访问，不然无法进行回调，注意第三方要返回一个 success 字符串 ， 不能有空格之类 或者其他的输出</div>
              </div>
              <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn" id="submitBtn" lay-submit >确认修改</button>
                </div>
              </div>
              </form>
            </div>
            
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="{{ADMIN_DOMAIN}}static/layui/layui.js"></script>    
  <script>
  layui.config({
    version: "{{version}}",
    base: '{{ADMIN_DOMAIN}}static/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'content'] , function(){
        var $ = layui.$
        ,form = layui.form
        ,element = layui.element;
        $('#submitBtn').click(function () {
          var loading = null ;
          $.ajax({
            type:'POST',
            url: '{{getu("user/base")}}',
            data: $('#myform').serializeArray(),
            dataType: 'JSON',
            success: function (res) {
                layer.close(loading);
                if( res['code'] != 1 ){
                  layer.msg(res['msg'] , {icon : 5 } )
                  return ;
                }
                layer.alert('修改成功', {}, function(){
                    parent.location.reload()
                });
            },
            beforeSend: function(){
              loading = layer.load(0, {shade: [0.1,'#fff']})
            },
            error: function (){
              layer.close(loading)
              layer.msg("网络繁忙请稍后" , {icon : 5 } )
            }
          });
        })
  });
  </script>
</body>
</html>